package com.woniuxy.carlife.carlifeuserweb.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.woniuxy.carlife.carlifecommonsweb.exception.CarlifeGlobalException;
import com.woniuxy.carlife.carlifeuserweb.entity.Maintenance;
import com.woniuxy.carlife.carlifeuserweb.mapper.MaintenanceMapper;
import com.woniuxy.carlife.carlifeuserweb.service.MaintenanceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author zjq
 * @ClassName:MaintenanceServiceImpl
 * @Description:汽车保养
 * @date 2021/4/6 20:02
 **/

@Service
public class MaintenanceServiceImpl extends ServiceImpl<MaintenanceMapper, Maintenance> implements MaintenanceService {

    @Resource
    MaintenanceMapper maintenanceMapper;




    /*
     * 功能描述〈用户根据车辆id(查询汽车表时同时查询)查询保养信息〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/12 9:08
     * @throws
     */

    @Override
    public Maintenance findfindMaintenanceByuserIdMaintenanceId(String usercarId)  {
        QueryWrapper<Maintenance> maintenanceQueryWrapper = new QueryWrapper<>();
        maintenanceQueryWrapper.eq("usercar_id", usercarId);
        Maintenance maintenance = maintenanceMapper.selectOne(maintenanceQueryWrapper);
        return maintenance == null ? null : maintenance;
    }
}
